package com.pdg.mcplugin.recyclotron;

import org.bukkit.plugin.PluginManager;

import com.pdg.mcplugin.common.baseclasses.PluginBase;

public class Recyclotron extends PluginBase {
	
	private RecyclotronEventHander eventHandler = null;
	public RecyclotronEventHander getEventHandler(){
		if(eventHandler==null){
			eventHandler = new RecyclotronEventHander(this);
		}
		return eventHandler;
	}
	
	private RecipeMaker recipeMaker;
	public RecipeMaker getRecipeMaker(){
		if(recipeMaker==null){
			recipeMaker = new RecipeMaker(this);
		}
		return recipeMaker;
	}

	//plugin manager
	private PluginManager pluginManager;
	public PluginManager getPluginManager(){
		if(pluginManager==null){
			pluginManager = getServer().getPluginManager();
		}
		return pluginManager;
	}
	@Override
	protected void disablePlugin() {
	}

	@Override
	protected boolean enablePlugin() {
		saveDefaultConfig();
		getRecipeMaker().makeRecipes();
		getPluginManager().registerEvents(getEventHandler(), this);
		return true;
	}
	
}
